import 'package:flutter/material.dart';

class MyAppBar extends StatelessWidget {

  MyAppBar({this.title});

  final Widget title;

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 56.0,
      padding: const EdgeInsets.symmetric(horizontal: 8.0),
      decoration: BoxDecoration(color: Colors.blue[500]),
      child: Row(
        children: <Widget>[
          IconButton(icon: new Icon(Icons.menu), onPressed: null, tooltip: 'Navigation menu',),
          Expanded(child: title),
          IconButton(icon: Icon(Icons.search), onPressed: null, tooltip: 'Search',)
        ],
      ),
    );
  }

}

class MyScaffold extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Material(
      child: Column(
        children: <Widget>[
          MyAppBar(
            // ignore: deprecated_member_use
            title: Text('Example title', style: Theme.of(context).primaryTextTheme.title,),
          ),
          Expanded(child: Center(child: Text('Hello world')))
        ],
      ),
    );
  }

}

void main(List<String> args) {
  runApp(new MaterialApp(
    title: 'My App',
    home: new MyScaffold(),
  ));
}